<?php

/*
 *function which check database for activation key and if found
 * activate the account
 *
 */

function tryActivate($actCode) {
    require_once 'C:\xampp\htdocs\GreenwichFreecycle\include\greenFreeDb.php';
    if(isVCodeAlreadyStoredDb($actCode)){ //TODO validate against the captcha aswell 
       return activateAccountDb($actCode);
    }// need to decide if to use id or username using activation code for now
    else {
    return false;    
    }
}

function isUserAndPasswordValid($userName, $userPassword){
    $compareName = $userName === userNameAlreadyAssignDb($userName);
    $comparePassword = sha1($userPassword) === passwordAlreadyAssignDb($userPassword);
    return $compareName && $comparePassword;
}
?>
